import os
import shutil

from utils.file_io import listdir

if __name__ == "__main__":
    sound_root_path = "wav"
    srt_root_path = "srt"

    wav_file_list = []
    listdir(sound_root_path+"/input/", wav_file_list)
    for wav in wav_file_list:
        wav_name = str(wav).split("/")[-1]
        wav_name_list = wav_name.split("_")
        wav_name_begin = wav_name_list[0]+"_"+wav_name_list[1]+"_"+wav_name_list[2]
        if not os.path.exists(sound_root_path+"/input/"+wav_name_begin+"/"):
            os.mkdir(sound_root_path+"/input/"+wav_name_begin+"/")

        shutil.move(sound_root_path+"/input/"+wav_name, sound_root_path+"/input/"+wav_name_begin+"/"+wav_name)